package com.jixi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jixi.mapper.StudentMapper;
import com.jixi.pojo.entity.Student;
import com.jixi.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements StudentService {
    
    @Autowired
    private StudentMapper studentMapper;
    
    /**
     * 统计学生数量
     *
     * @return 学生数量
     */
    @Override
    public Long countStudentNum() {
        LambdaQueryWrapper<Student> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Student::getIsDeleted, 0);
        return studentMapper.selectCount(queryWrapper);
    }
}
